package com.ithuameng.admin.app.system.controller;

import com.ithuameng.admin.app.system.model.vo.R;
import com.ithuameng.admin.enums.CommonError;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 权限URL控制器
 *
 * @author ithuameng
 */
@Api(tags = "权限URL控制器")
@RestController
@RequestMapping(value = "/admin/v1/common")
public class CommonController {

    /**
     * 未授权访问
     */
    @RequestMapping(value = "/error/unauthorized")
    public R<Void> unauthorized() {
        return new R<>(CommonError.UNAUTHORIZED);
    }

    /**
     * 无权查看
     */
    @RequestMapping(value = "/error/accessdenied")
    public R<Void> accessdenied() {
        return new R<>(CommonError.FORBIDDEN);
    }

    /**
     * 其它客户端登陆
     */
    @RequestMapping(value = "/error/multilogin")
    public R<Void> multilogin() {
        return new R<>(CommonError.UNAUTHORIZED, "其它客户端登陆");
    }
}
